Introduction (Tamer)

The Opioid Crisis is truly that - a crisis. Over the past 20 years, opioids have become a commonly used recreational drug. As people use these drugs, they become addicted. Opioid abuse often starts with a legitimate prescription as a treatment for pain. However, the addictive nature of the drug can cause people to seek out more opioids after their prescription is over. In small doses, opioids are effective painkillers that may make you feel drowsy. In large doses (abuse), opioids can result in slowed breathing and a slowed heart-rate. These effects can cause death - otherwise known as an overdose.

The amount of opioids prescribed began growing a lot in 2006 and peaked in 2012 with 255 million doses prescribed. Since 2012, overall doses prescribed has diminished to 168 million in 2018; however, that is still a huge number of opioid doses. Unfortunately, overdoses have also been on the rise and - unlike prescriptions - are continuing to rise (as can be seen in the figure below).

image

The mechanism by which legitimate prescriptions may lead someone down the path to opioid abuse and potentially overdosing is one of addiction. When someone is legally prescribed opioids (potentially an excessive number of doses) they are subject to developing an addiction. If they do, then they may go searching for more opioids after their prescription runs out. The most common replacements are drugs like heroin and fentanyl. Heroin and fentanyl, which is over 100 times the strength of morphine - a notoriously powerful painkiller, are very strong opioids that can very easily lead to overdose even after just one use. It is also worth noting that even prescription opioids cause deaths, not just the super strong types.

For this project, we wanted to explore the relationship between opioid prescription rate and overdose rate and figure out which (if there are any) states that are disproportionately affected.

Data

Prescription Rate Data

Talk about data here

Overdose Rate Data (Chris)

Where data is from explain what it is

Analysis

Prescription Rate vs. Overdose Rate (Chris)

  1. Show maps
  2. Ask Questions about whether one causes the other, etc.

Regression

# scatter / regression between prescription rate and overdose rate
mod <- lm(age_adjusted_rate ~ prescription_rate, data = full_data)
msummary(mod)
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       18.52501    2.00731   9.229   <2e-16 ***
## prescription_rate  0.01915    0.02768   0.692     0.49    
## 
## Residual standard error: 9.043 on 248 degrees of freedom
## Multiple R-squared:  0.001926,   Adjusted R-squared:  -0.002099 
## F-statistic: 0.4785 on 1 and 248 DF,  p-value: 0.4897
ggplot(data = full_data, aes(x = prescription_rate)) +
  geom_histogram(bins = 15)

ggplot(data = full_data, aes(x = prescription_rate, y = age_adjusted_rate)) +
  geom_point() + 
  geom_abline(intercept = 7.56323, slope = 0.10475)

K-Means Clustering

Text explaining why k-means

wanted to group state based on severity of the problem

Determining the Optimal K

While oftentimes you have to determine the optimal k for k-means clustering yourself, we wrote code to determine it for you. We determined the optimal k by selecting the largest mean silhouette coefficient. The silhouette coefficient is calculated using the mean intra-cluster distance and the mean nearest-cluster distance for all samples. The values range from -1 (samples are assigned to the wrong cluster) to 1 (best possible value). The function below runs k-mean clustering on a given k, and then calculates the mean silhouette coefficient using the silhouette function from the cluster package. We are providing k inputs from 2-5, and then searching for the largest value.

# Helper function to calculate mean silhouette coefficient
silhouette_score <- function(k){
  km <- kmeans(full_data[, 2:3], centers = k, nstart = 20)
  score <- cluster::silhouette(km$cluster, dist(full_data[, 2:3]))
  mean(score[, 3])
}
# Follow up code to get the maximum silhouette coefficient
k <- 2:5
avg_sil <- sapply(k, silhouette_score)
optimal_k <- which(as.data.frame(avg_sil)$avg_sil == max(avg_sil)) + 1

Clustering for 2014-2018

2014

2015

2016

2017

2018

text about the clustering

Conclusion (Chris, Sean)